﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using DR.WebUI.Models.Enums;

namespace DR.WebUI.Models.Project
{
    public class ViewProject
    {
        public int ID { get; set; }
        public string Title { get; set; }
        public string Description { get; set; }
        public DateTime DateCreate { get; set; }
        public DateTime StartDate { get; set; }
        public DateTime? FinishDate { get; set; }
        public ProjectStatus Status { get; set; }
    }

    public class NewProject
    {
        [Required]
        [StringLength(50)]
        public string ProjectName { get; set; }

        [Required]
        public DateTime StartDate { get; set; }

        public DateTime? FinishDate { get; set; }

        [Required]
        public ProjectStatus Status { get; set; }

        [StringLength(1000)]
        public string Description { get; set; }
    }

    public class EditProject
    {
        public int ProjectID { get; set; }

        [Required]
        [StringLength(50)]
        public string ProjectName { get; set; }

        [Required]
        public DateTime DateCreate { get; set; }

        [Required]
        public DateTime DateStart { get; set; }

        public DateTime? DateFinish { get; set; }

        [Required]
        public ProjectStatus Status { get; set; }

        [StringLength(1000)]
        public string Description { get; set; }
    }

    public class ProjectFilter
    {
        [StringLength(50)]
        public string ProjectName { get; set; }

        public DateTime? DateLeft { get; set; }
        public DateTime? DateRight { get; set; }

        private ISet<int> selectedProjectStatuses = new HashSet<int>();
        public ISet<int> SelectedProjectStatuses
        {
            get
            {
                return selectedProjectStatuses;
            }
        }

        public ProjectFilter()
        {
            selectedProjectStatuses.Add((int)ProjectStatus.Open);
            selectedProjectStatuses.Add((int)ProjectStatus.Frozen);
            selectedProjectStatuses.Add((int)ProjectStatus.Closed);
        }

    }

    public class ProjectDetailModel
    {
        public int ProjectID {get; set;}
        public string ProjectName { get; set; }
        public string DateCreate { get; set; }
        public string DateStart { get; set; }
        public string FinishDate { get; set; }
        public int State { get; set; }
        public string Description { get; set; }
           
      
       
        
       // public bool CanDeleteByDeveloper { get; set; }
       // public bool CanEditByDeveloper { get; set; }
    }
}